
package org.appfuse.service.impl;

import java.util.List;

import org.appfuse.service.impl.BaseManager;
import org.appfuse.model.Menu;
import org.appfuse.dao.MenuDao;
import org.appfuse.service.MenuManager;

public class MenuManagerImpl extends BaseManager implements MenuManager {
    private MenuDao dao;

    /**
     * Set the Dao for communication with the data layer.
     * @param dao
     */
    public void setMenuDao(MenuDao dao) {
        this.dao = dao;
    }

    /**
     * @see org.appfuse.service.MenuManager#getMenus(org.appfuse.model.Menu)
     */
    public List getMenus(final Menu menu) {
        return dao.getMenus(menu);
    }

    /**
     * @see org.appfuse.service.MenuManager#getMenu(String id)
     */
    public Menu getMenu(final String id) {
        return dao.getMenu(new Long(id));
    }

    /**
     * @see org.appfuse.service.MenuManager#saveMenu(Menu menu)
     */
    public void saveMenu(Menu menu) {
        dao.saveMenu(menu);
    }

    /**
     * @see org.appfuse.service.MenuManager#removeMenu(String id)
     */
    public void removeMenu(final String id) {
        dao.removeMenu(new Long(id));
    }
}
